package com.admin.controller.admin.upload;

import com.system.constant.HTTPStatus;
import com.system.response.Result;
import com.system.util.QiniuUtil;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

/**
 * @author zfc
 * @Date 2024/3/5 10:51
 * @Description QiniuyunUploadController
 */
@RestController
@RequestMapping("/qiniuyun")
public class QiniuyunUploadController {
    @PostMapping("/backend/uplodPhoto")
    public Result backendAddPhoto(@RequestParam("file") MultipartFile file) {
        String uploadFile = QiniuUtil.uploadFile(file);

        return new Result<>().setCode(HTTPStatus.SUCCESS).setData(uploadFile);
    }
}
